import json
import pandas as pd
import re
from html2text import html2text

import sys
sys.path.append('/workspace/qanything_local')
from qanything_kernel.dependent_server.llm_api_serve.glm4_serve import ZhipuAILLM


def main():
    llm = ZhipuAILLM()
    streaming = False
    chat_history = []

    qa_file_path = '/workspace/qanything_local/qanything_kernel/row_data/poc_1.7w+_data/standard_qa_pair.json'


    prompt = """现在你是改写问句小能手，根据我提供的查询语句，必须在不改变句子意思的前提下，帮我改写生成若干个问句。改写的问句放到python列表中输出，例如：[xxx,...,xxx]，其他额外信息不要输出。
    查询语句：{query}
    改写的问句尽可能的满足不同人群的语气、措辞和表述方式等。
    """
    with open(qa_file_path, 'r', encoding='utf-8') as files:
        item = json.load(files)
        for data in item:
            query = data.get('问题')
            response = llm.chat(prompt=prompt.format(query=query), model_name='glm-3-turbo')
            print(response)
            

if __name__ == "__main__":
    main()